var vidboardCheckedItems;
var data_data;
function getvidboardData() {
    
    
    
	var startDate = $("#vidboardStartDate").val();

    var osID = document.getElementById("vidboardOS").options[document.getElementById("vidboardOS").selectedIndex].value;
	var typeID = document.getElementById("vidboardType").options[document.getElementById("vidboardType").selectedIndex].value;
    
   

	//$(".vidboardChart").html("");
	if (startDate != "")
	{
		var start = new Date();
		var end = new Date();

		//统计项
		var items = document.getElementsByName("vidboardCheckbox");
		vidboardCheckedItems = new Array();
		for(var i=0;i<items.length;i++) {
			if (items[i].checked)
			{
				vidboardCheckedItems.push(items[i].value);
			}
		}

		if(vidboardCheckedItems.length > 0) {


			jQuery('#body-wrapper').showLoading();
			

			var APIurl = "/client/vidboard?staDate="+startDate;
	        
            if (osID != "")
				APIurl += "&os="+osID;
			if (typeID != "")
				APIurl += "&dt="+typeID;
            

			
			$.ajax({
				type: "GET",
				url: APIurl,
				dataType : "json",
				success:function(data){ loadvidboardData(data)}
			});
		}
		else {
			alert("请选择至少一个统计项");
		}

	}
	else {
		alert("请选择时间区域");
	}
}


var vidboardTabArr, vidboardDetailArr, vidboardSumArr, vidboardDateArr, MainSubTitle;
function loadvidboardData(data) {
    data_data = data;
   
    genTabsvidboard("vidboard");


	jQuery('#body-wrapper').hideLoading();	
    
    //alert('123');


            //读取数据            
			changeChartType('vidboard','Table');

        
        
        
        //生成表格
        genTop10Tableboard("vidboardTable",data['day'],"day",data['daytime']);
        
        
    
	
}


function changevidboardTab(tabName,optionName) {
	
        
        //生成表格
        genTop10Tableboard("vidboardTable",data_data[tabName],tabName,data_data[tabName+'time']);

    $("#vidboardTabday").removeClass("selbitem");
    $("#vidboardTabweek").removeClass("selbitem");
	$("#vidboardTab"+tabName).addClass("selbitem");	
    
    
    
	
}

